/* TRUE if cursor is inside this window */
gboolean cursor_inside;
+ gboolean pending_spec_update;
gint output_scale;
};
if (attributes && attributes_mask & GDK_WA_TYPE_HINT)
impl->type_hint = attributes->type_hint;
+ impl->pending_spec_update = TRUE;
+
return (GdkWindowImpl *) impl;
}
set_surface_state (GdkMirWindowImpl *impl,
MirSurfaceState state)
{
+ MirConnection *connection = gdk_mir_display_get_mir_connection (impl->display);
if (impl->surface_state == state)
return;
impl->surface_state = state;
- if (impl->surface)
- mir_surface_set_state (impl->surface, state);
+ if (impl->surface && !impl->pending_spec_update)
+ {
+ MirSurfaceSpec *spec = mir_connection_create_spec_for_changes (connection);
+ mir_surface_spec_set_state (spec, state);
+ mir_surface_apply_spec (impl->surface, spec);
+ mir_surface_spec_release (spec);
+ }
}
static void
mir_surface_apply_spec (impl->surface, spec);
mir_surface_spec_release (spec);
+ impl->pending_spec_update = FALSE;
impl->buffer_stream = mir_surface_get_buffer_stream (impl->surface);
}
MirSurfaceSpec *spec;
if (impl->surface)
- return;
+ {
+ if (impl->pending_spec_update)
+ update_surface_spec(window);
+ return;
+ }
/* no destroy notify -- we must leak for now
* https://bugs.launchpad.net/mir/+bug/1324100
impl->surface = mir_surface_create_sync (spec);
mir_surface_spec_release(spec);
+
+ impl->pending_spec_update = FALSE;
impl->buffer_stream = mir_surface_get_buffer_stream (impl->surface);
/* FIXME: can't make an initial resize event */
/* The Cairo context is no longer valid */
g_clear_pointer (&impl->cairo_surface, cairo_surface_destroy);
+ if (impl->pending_spec_update)
+ update_surface_spec (window);
+
+ impl->pending_spec_update = FALSE;
}
static cairo_surface_t *
/* We accept any resize */
window->width = width;
window->height = height;
+ impl->pending_spec_update = TRUE;
}
/* Transient windows can move wherever they want */
impl->has_rect = FALSE;
impl->transient_x = x;
impl->transient_y = y;
- update_surface_spec (window);
+ if (!impl->pending_spec_update && impl->surface)
+ update_surface_spec (window);
}
}
}
if (hint != impl->type_hint)
{
impl->type_hint = hint;
- update_surface_spec (window);
+ if (impl->surface && !impl->pending_spec_update)
+ update_surface_spec (window);
}
}
/* Link this window to the parent */
impl->transient_for = parent;
+
+ if (impl->surface && !impl->pending_spec_update)
+ update_surface_spec (window);
}
static void